Tumbler is a tool for generating Acrobat Portable Document Format (PDF) files from QuickDraw GX Portable Digital Documents (PDDs). On a Macintosh with QuickDraw GX installed, you can generate a PDD from any application by printing to the PDD Maker driver. After converting this PDD with Tumbler, you can give the resulting PDF file to anybody who has a copy of Adobe’s free Acrobat Reader, and they can view and print it with all the correct fonts and layout, including all the nice GX typography, even if they aren’t using GX or a Mac.
Note: Tumbler is still under development. It has undergone only limited testing, and there are some known bugs and limitations, and no doubt others I don’t know about. Use it with care for now, and let me know of any problems you encounter, or any suggestions you have for improvement (my contact info is below). I am intending to release it in the future as shareware (for a suggested price of, say, US$25 for a single-user licence).
• Using Tumbler
To run Tumbler, you will need a Mac with QuickDraw GX installed. The simplest way to do a conversion is to use the “Open...” command to select the PDD to convert. Next, you will be prompted to give a name under which to save the resulting PDF file, and choose an option for font encoding and embedding (see below). Once you’ve done this, a progress window should appear, and when this disappears, the conversion should be done.
The save dialog contains a pair of radio buttons that affect the fidelity of GX typography in the resulting PDF file. The default setting, “Preserve GX Typography, Embed Fonts”, maintains maximum fidelity of GX typographic features such as ligatures and contextual forms. The cost of this is increased size of the resulting PDF file, because I have to embed copies of all the fonts. It would be nice if I could just specify custom encodings for the fonts (and separate the encoding option from the embedding one), but I can’t get this to work.
The other setting, “Simple Encodings, Don’t Embed Fonts”, forces all text to be interpreted according to the standard Macintosh Roman encoding. It also means that fonts are not embedded in the PDF file, so the file size is smaller. This setting works best for documents created from GX-unaware applications that take no advantage of GX typography.
You can exercise more control over the conversion process by driving it from AppleScript. In particular, you can specify a “PDF Settings” record containing the above conversion option and lots of others, as well as specifying informational strings to be included in the document for display by Acrobat Reader.
• Known problems
There are still some odd problems with fonts. Text using embedded TrueType fonts will sometimes display with incorrect clipping, particularly if it’s rotated. This is a bug in Acrobat Reader 2.1. The text seems to print correctly on PostScript printers (most of the time) from systems without GX installed, but may print as garbage from GX-equipped systems. Also, embedded Type 1 fonts may not display on-screen on GX-equipped systems, though they may look OK on systems without GX. I’m not sure whose fault these problems are yet.
The generated PDF files can be quite large, for several reasons. One is because GX seems to individually position every glyph in a text layout, and the corresponding PDF commands are quite verbose. I can probably mitigate this in future by adding LZW compression of the PDF data.
Text can be slow to display when you elect to preserve GX typography. This seems to be because of the individual positioning of the glyphs.
If you try to stop a conversion, it won’t actually stop until the current page is finished. (I think I’ve fixed this.)
If Tumbler runs out of memory during a conversion, you’re not likely to get an error message. Alternatively, Tumbler might crash. An easy way to trigger this situation is to try to do two conversions at once.
If you preserve GX typography, the included text has randomly-assigned character encodings, so text searches and copy/paste don’t work. PDF limitations make it too hard to try to fix this.
Not all the fancy GX graphics will convert correctly, mostly because limitations in the PostScript/PDF graphics model make it too hard. One difference is that filled shapes tend to look thicker in Acrobat (the discrepancy becomes less at higher magnifications and higher device resolutions); this is because of a disagreement between the PostScript and GX scan-conversion algorithms over which pixels to fill. Transfer modes are ignored, however I have successfully converted some line caps and dashes. One fill pattern I tried to convert hung my machine (this looked like a GX bug).
• Development history:
1995 October 16 — started the project.
1995 October 21-23 — created my first valid PDF files.
0.5d1 1995 November 13 — First distribution to someone other than myself. All conversions must be done via AppleScript.
0.5d2 1995 November 14 — Made some small improvements I can’t remember now. Limited distribution to a handful of people.
0.6d1 1995 November 27 — Tried to switch to embedding fonts in Type 1 or TrueType format, so far without success. Used more compact PDF text-positioning commands, which reduces the typical size of the generated files by over 25%.
0.6d2 1995 December 5 — Added a functioning “Open...” menu command, and progress windows with “Stop” buttons, so you can do at least basic conversions without resorting to AppleScript. First public test release.
1996 February 27 — fixed a formatting bug that would produce bad PDF files; oddly, this only happened on machines without hardware floating point (my code makes no direct use of hardware floating point). Shape clips now work (apart from inverse clips, which PostScript doesn’t support). You can now use the AppleScript “make” command to create a conversion context and individually add pages to it with “add page”.
1996 March 6-7 — embedded TrueType fonts now work! I achieved this by giving up trying to reencode the font via PDF, and directly replacing the font’s “cmap” table instead. As a result, on-screen text quality is now considerably improved. However, Type 1 fonts still do not work—text displayed using a Type 1 font comes out as all blanks.
0.6d5 1996 March 8 — added an option to the save dialog to control the “correct encodings” option without having to resort to AppleScript.
1996 March 13-14 — a first stab at supporting transfer modes (I know I’d said I wouldn’t do this). Doesn’t work all that well.
1996 March 14-15 — support indexed colour spaces for bitmap objects. This should cut file sizes down a bit, as I no longer force all indexed bitmaps to 24-bit RGB.
1996 May ≤17 — Perspective mappings should now work. For text shapes, these are done by converting to paths. Improved handling of GX transfer modes, but still a few quirks and hangs.
1996 May 24 — I am now able to subset TrueType fonts. This should cut down file sizes a bit.
1996 May 31 — subsetted TrueType fonts now print properly!
1996 June 19 — I no longer rely on the default pen width in the initial PDF graphics state, to get around a bug in Acrobat Reader 2.1.
1996 June 25 — Got my first embedded Type 1 font to print to a PostScript printer. Unfortunately, it won’t display on-screen.
1996 June 27 — Got rendering of text faces (algorithmic bolding, shadowing etc) to work.
1996 July 2 — changed text face rendering to use Type 3 fonts rather than path shapes. This reduces file sizes somewhat, though it now means that turning off correct encodings also loses text faces. There is now an option to generate thumbnails (off by default).
0.6d6 1996 July 4 — I now recognize cubic synonym tags attached to path shapes. I tried embedding an actual Type 1 font (as opposed to a TrueType font converted to Type 1) and it worked! It displayed (and printed) correctly on a system without GX installed, though not on one with GX.